package LinkedList;

public class ReLinkedList {

}
class Solution {
    public ListNode reverseList(ListNode head) {
     ListNode pre=null;
     ListNode cur=head;

        while (cur!=null){
            ListNode temp = new ListNode();
            temp=cur.next;
            cur.next=pre;
            pre=cur;
            cur=temp;

        }
        return pre;
    }
}